<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
		<link href="bitbug_favicon.ico" rel="shortcut icon" />
	</head>
	<body>
		<div class="login">
			<h2>登录</h2>
			<p class="username" >用户名：<input id="user" type="text" placeholder="请输入用户名" value=""/></p>
			<p class="pws">密&nbsp;码：&nbsp;&nbsp;<input id="password" type="password" placeholder="请输入密码"/></p>
			<p class="button">
				<a href="index.html">取消</a>
				<a href="javascript:;" id="login">登录</a>
			</p>
		</div>
	</body>
	<script src="js/jquery1111.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/config.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="js/jquery1111.min.js" ></script>
	<script type="text/javascript" src="js/jquery.session.js" ></script>
	<script type="text/javascript">
		$('#login').click(function(){
			console.log(1)
			$.ajax({
				url: serverPath + 'login',
				data:{
					username:$('#user').val(),
					password:$('#password').val(),
				},
				type: 'get',
				dataType: 'json',
				success: function(json){
					if(json.code==2001){
						alert(json.msg)
					}else{
						document.cookie="name=" +json.objs.name
						baseUser=json.objs;
						$.session.set('name',json.objs.name);
						alert('恭喜您登录成功')
						window.location = 'index.html';
					}
				},
				error: function(){
					alert('error');
				}
			});
			
		})
		
	
	</script>
</html>
